<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<div class="modal-dialog demo2do-modal-dialog">

  <div class="modal-content">
		
	<div class="modal-header strawberry-breadcrumb clearfix">
		    		
	  <h2>
		<i class="glyphicon glyphicon-fire" title=""></i>
		<span><fmt:message key="${fundProgressType.key}" />&nbsp;-&nbsp;${startup.profile.name}</span>
	  </h2>
				
	  <button type="button" class="close" data-dismiss="modal">&times;</button>
				    	
	</div>
		    		
	<form class="form-horizontal" method="post" action="${ctx}/startups/${startup.id}/fund-progress" data-validate="true">
		
	  <div class="modal-body">
			
	    <div class="form-group demo2do-form-group no-hover">
		  <label class="col-lg-4 control-label"><fmt:message key="${startup.fundStatus.key}" /></label>
	      <div class="col-lg-5">
			<p><img src="${ctx.upload}/${startup.profile.avatar}" width="56" height="56" style="border: 1px solid #ddd;"/>&nbsp;&nbsp;${startup.profile.name}</p>
		  </div>
		</div>
		
		<div class="form-group demo2do-form-group no-hover">
		  <label class="col-lg-4 control-label">最小投资金额</label>
		  <div class="col-lg-5 form-control-static">
		    <p class="text-prefunding font-weight-bold">&yen;&nbsp;<fmt:formatNumber value="${startup.fund.minimum}" type="number"/>万</p>
		  </div>
		</div>
		
		<div class="form-group demo2do-form-group no-hover">
		  <label class="col-lg-4 control-label">是否领投</label>
		  <div class="col-lg-5 form-control-static">
		    <input type="checkbox" name="leaded-flag"  ${startup.fundStatus.alias == 'prefunding' ? 'checked disabled' : ''} ${startup.fundStatus.alias == 'funding' ? 'disabled' : ''} data-on-color="success" data-off-color="warning" data-on-text="&nbsp;&nbsp;是&nbsp;&nbsp;" data-off-text="&nbsp;&nbsp;否&nbsp;&nbsp;" >
		    <input type="hidden" name="leaded" value="${startup.fundStatus.alias == 'prefunding' ? 'true' : 'false'}">
		  </div>
		</div>
		
		<div class="form-group demo2do-form-group no-hover">
		  <label class="col-lg-4 control-label">投资金额</label>
		  <div class="input-group demo2do-input-group col-lg-5">
	        <input type="text" name="sum" class="form-control zz-form-control" placeholder="本次参与投资金额" data-validate="required|min,${startup.fund.minimum}">
	        <span class="input-group-addon">万</span>
	      </div>
		</div>
		
	  </div>		
	
	  <div class="modal-footer">
        <button type="submit" class="btn btn-success btn-shadow btn-shadow-success demo2do-input-large-width">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default demo2do-input-large-width" data-dismiss="modal">取消</button>
      </div>
		
    </form>
	
  </div>
</div>

<script src="${ctx.resource}/js/bootstrap-validate-trigger.js"></script>
<script>

  $(function() {
	$('input[name=leaded-flag]').bootstrapSwitch({
	  onSwitchChange: function(event, state) {
		if(state) {
		  $('input[name="leaded"]').val("true");
		} else {
		  $('input[name="leaded"]').val("false");
		}
	  }
	});
  });

</script>
